﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace Protocol.OUSProtocol.Model
{
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    public struct SParams
    {
        //温度曲线
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] tempFig_Day;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] tempFig_Target_Day;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] tempFig_Target_Night;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] tempFig_dTempMax;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public UInt32[] tempFig_WindMin;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public UInt32[] tempFig_WindMax;

        //制冷--曲线 最后一个为自设模式的参数
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] cool_Day;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] cool_STime;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] cool_ETime;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] cool_STemp;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] cool_ETemp;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] cool_EHumi;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] cool_On;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] cool_Off;

        //加热 6组 曲线
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] heat_Day;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] heat_STime;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] heat_ETime;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] heat_STemp;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] heat_ETemp;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] heat_On;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] heat_Off;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
        public ushort[] heat_Percent;

        //定时输出
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
        public ushort[] timer_On;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
        public ushort[] timer_Off;

        //校准
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
        public short[] cal_dTemp;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
        public short[] cal_dHumi;
        public short cal_dNH3;
        public short cal_dCO2;
        public UInt32 cal_Wind;
        public UInt32 cal_Pulse;

        //数量统计
        public ushort mh_Day;
        public ushort mh_PigNum;
        public UInt32 mh_PerWind;
        public byte sys_NH3CO2;
        public byte addr_Wmeter;
        public byte addr_Emeter;
        public byte rev;

        //模式控制
        public Byte sys_RunMode;
        public Byte sys_TempMode;
        public Byte sys_WindMode;
        public Byte sys_DoorMode;

        //系统变量
        public ushort sys_FanMin;
        public ushort sys_DoorMin;
        public ushort sys_WindStep;
        public ushort sys_DoorStep;
        public ushort sys_WindTime;
        public ushort sys_HumiAdd;
        public ushort sys_HumiHigh;
        public ushort sys_Humi_Delay;
        public ushort sys_NH3Add;
        public ushort sys_NH3High;
        public ushort sys_NH3_Delay;
        public ushort sys_CO2Add;
        public ushort sys_CO2High;
        public ushort sys_CO2_Delay;
        public ushort sys_DayStart;
        public ushort sys_DayEnd;

        //报警参数
        public ushort alarm_DoorTO;
        public ushort alarm_TempMax;
        public ushort alarm_TempMin;
        public ushort alarm_TempDMax;
        public ushort alarm_TempDMin;
        public ushort alarm_HumiMax;
        public ushort alarm_HumiMin;
        public ushort alarm_CO2Max;
        public ushort alarm_NH3Max;
        public UInt32 alarm_WindMin;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
        public Byte[] alarm_TempSensor;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
        public Byte[] alarm_HumiSensor;
        public byte alarm_NH3Sensor;
        public byte alarm_CO2Sensor;
        public byte alarm_LostPower;
        public UInt32 sys_fixMaxWind;

        //通讯设置
        public UInt32 addr;
        public ushort serverPort;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
        public Byte[] serverIP;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
        public Byte[] localIP;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
        public Byte[] gateway;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
        public Byte[] netmask;
        public Byte comType;

    }
}
